﻿using DAL;
using IService;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Service
{
    public class WhOutboundService : IWhOutboundService
    {
        public WhOutboundDal dal;
        public WhOutboundService(WhOutboundDal dal)
        {
            this.dal = dal;
        }

        public Task<int> CreateAsync(WhOutbound data)
        {
            return dal.CreateAsync(data);
        }

        public Task<WhOutbound> GetByIdAsync(long Id)
        {
            return dal.GetByIdAsync(Id);
        }

        public Task<List<StockOutDetailDto>> GetWhOutboundAll()
        {
            return dal.GetWhOutboundAll();
        }
        public Task<List<StockOutDetailDto>> GetWhOutboundByParams(StockOutQueryParams parameters)
        {
            return dal.GetWhOutboundByParams(parameters);
        }
        public Task<List<StockOutDetailDto>> GetWhOutboundId(long id)
        {
           return dal.GetWhOutboundId(id);
        }
        public Task<int> CreateOutboundWithDetailsAsync(WhOutbound outbound, List<WhOutboundDetail> details)
        {
            return dal.CreateOutboundWithDetailsAsync(outbound, details);
        }

        public Task<List<SalesOrderAvailableGoodsDto>> GetAvailableGoodsBySalesOrder(string salesOrderNo)
        {
            return dal.GetAvailableGoodsBySalesOrder(salesOrderNo);
        }

        public Task<List<WhLocation>> WhLocationAllAsync()
        {
            return dal.WhLocationAllAsync();
        }

        public Task<List<WhLocation>> GetLocationsByWarehouseIdAsync(long warehouseId)
        {
            return dal.GetLocationsByWarehouseIdAsync(warehouseId);
        }

        public Task<List<Users>> UserAll()
        {
            return dal.UserAll();
        }

        public Task<int> UpdateAuditorComment(Auditor date)
        {
            return dal.UpdateAuditorComment(date);
        }
        public Task<int> AuditorStatus(string status, long id)
        {
            return dal.AuditorStatus(status, id);
        }
        public Task<int> Status(string status, long id)
        {
            return dal.Status(status, id);
        }
        public async Task<int> ExecuteActualOutbound(long stockOutOrderId)
        {
            return await dal.ExecuteActualOutbound(stockOutOrderId);
        }

        public Task<int> DeleteAsync(long Id)
        {
            return dal.DeleteAsync(Id);
        }
    }
}
